algorithm of largest among three numbers